package com.run2code.design.behavioral.responsibilitychain;

import java.util.Calendar;
import java.util.Date;

/**
 * 审核链抽象类
 * 关注公众号【奔跑的码畜】，一起进步不迷路
 *
 * @author 第七人格
 * @date 2024/01/02
 */
public abstract class AuditChain implements Handler {

    protected String auditorId;
    protected String auditorName;
    private AuditChain next;

    public static int getDayOfMonth(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return calendar.get(Calendar.DAY_OF_MONTH);
    }

    public AuditChain(String auditorId, String auditorName) {
        this.auditorId = auditorId;
        this.auditorName = auditorName;
    }

    public AuditChain next() {
        return next;
    }

    public AuditChain addChain(AuditChain next) {
        this.next = next;
        return this;
    }

    public abstract void audit(String orderId, Date auditDate);

}
